function GetSoapXml() {
    var soapBody = "<soap:Body>" +
        "<RetrieveMultiple xmlns='http://schemas.microsoft.com/crm/2007/WebServices\'>" +
        "<query xmlns:q1='http://schemas.microsoft.com/crm/2006/Query' xsi:type='q1:QueryExpression'>" +
        "<q1:EntityName>activitypointer</q1:EntityName>" +

        "<q1:ColumnSet xsi:type='q1:ColumnSet'>" +
        "<q1:Attributes>" +
        "<q1:Attribute>subject</q1:Attribute>" +
        "<q1:Attribute>regardingobjectid</q1:Attribute>" +
        "<q1:Attribute>activitytypecode</q1:Attribute>" +
        "<q1:Attribute>scheduledend</q1:Attribute>" +
        "</q1:Attributes>" +
        "</q1:ColumnSet>" +

        "<q1:Criteria>" +
        "<q1:FilterOperator>And</q1:FilterOperator>" +        
        "<q1:Conditions>" +        
        "<q1:Condition>" +
        "<q1:AttributeName>ownerid</q1:AttributeName>" +
        "<q1:Operator>EqualUserId</q1:Operator>" +
        "</q1:Condition>" +
        "</q1:Conditions>" +        
        "<q1:Conditions>" +
        "<q1:Condition>" +
        "<q1:AttributeName>statecode</q1:AttributeName>" +
        "<q1:Operator>In</q1:Operator>" +
        "<q1:Values>" +
        "<q1:Value>Scheduled</q1:Value>" +
        "<q1:Value>Open</q1:Value>" +
        "</q1:Values>" +
        "</q1:Condition>" +
        "</q1:Conditions>" +
        "</q1:Criteria>" +

        "<q1:Orders>" +
        "<q1:Order>" +
        "<q1:AttributeName>" + SORTBY + "</q1:AttributeName>" +
        "<q1:OrderType>Ascending</q1:OrderType>" +
        "</q1:Order>" +
        "</q1:Orders>" +
        
        "</query>" +
        "</RetrieveMultiple></soap:Body>";

    var authenticationHeader = "<soap:Header>" +
        "<CrmAuthenticationToken xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>" +
            "<AuthenticationType xmlns='http://schemas.microsoft.com/crm/2007/CoreTypes'>0</AuthenticationType>" +
            "<CrmTicket xmlns='http://schemas.microsoft.com/crm/2007/CoreTypes'></CrmTicket>" +
            "<OrganizationName xmlns='http://schemas.microsoft.com/crm/2007/CoreTypes'>" + CRM_ORGANIZATION + "</OrganizationName>" +
            "<CallerId xmlns='http://schemas.microsoft.com/crm/2007/CoreTypes'>00000000-0000-0000-0000-000000000000</CallerId>" +
        "</CrmAuthenticationToken>" +
        "</soap:Header>";

    var soapXml = "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>";
    soapXml += authenticationHeader;
    soapXml += soapBody;
    soapXml += "</soap:Envelope>";

    return soapXml;
}